<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WPF3D" Width="534"
        Height="254"
        >
  <Window.Resources>
    <Style TargetType="TextBox"
           >
      <Setter Property="Text" Value="Default Text &amp;&lt;" />
      <Style.Triggers>
        <!--  Elements no line break between attributes: "Trigger"  -->
        <Trigger Property="IsEnabled" Value="false">
          <Setter Property="Background" Value="#EEEEEE" />
        </Trigger>

        <MultiTrigger>
          <MultiTrigger.Conditions>
            <!--  Elements no line break between attributes: "Condition"  -->
            <Condition Property="Content" Value="false" />
            <Condition Property="Width" Value="Auto" />
          </MultiTrigger.Conditions>
          <Setter Property="MinWidth" Value="120" />
        </MultiTrigger>

        <MultiTrigger>
          <MultiTrigger.Conditions>
            <Condition Property="Content" Value="false" />
            <Condition Property="Height" Value="Auto" />
          </MultiTrigger.Conditions>
          <Setter Property="MinHeight" Value="95" />
        </MultiTrigger>
      </Style.Triggers>
    </Style>
  </Window.Resources>
  <Grid>
    <DockPanel Grid.Row="0" Grid.RowSpan="1" Grid.Column="0"
               Grid.ColumnSpan="1" Width="Auto" Height="Auto"
               Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
               >
      <StackPanel>
        <StackPanel.Background>
          <LinearGradientBrush>
            <GradientStop Offset="0" Color="White" />
            <GradientStop Offset=".3" Color="DarkKhaki" />
            <GradientStop Offset=".7" Color="DarkKhaki" />
            <GradientStop Offset="1" Color="White" />
          </LinearGradientBrush>
        </StackPanel.Background>
        <StackPanel Margin="10"
                    >
          <TextBlock Text="Camera X Position:"
                     />
          <TextBox Name="cameraPositionXTextBox" HorizontalAlignment="Left" MaxLength="5"
                   Text="9"
                   />
          <TextBlock Text="Camera Y Position:"
                     />
          <TextBox Name="cameraPositionYTextBox" HorizontalAlignment="Left" MaxLength="5"
                   Text="8"
                   />
          <TextBlock Text="Camera Z Position:"
                     />
          <TextBox Name="cameraPositionZTextBox" HorizontalAlignment="Left" MaxLength="5"
                   Text="10"
                   />
          <Separator />
          <TextBlock Text="Look Direction X:"
                     />
          <TextBox Name="lookAtXTextBox" HorizontalAlignment="Left" MaxLength="5"
                   Text="-9"
                   />
          <TextBlock Text="Look Direction Y:"
                     />
          <TextBox Name="lookAtYTextBox" HorizontalAlignment="Left" MaxLength="5"
                   Text="-8"
                   />
          <TextBlock Text="Look Direction Z:"
                     />
          <TextBox Name="lookAtZTextBox" HorizontalAlignment="Left" MaxLength="5"
                   Text="-10"
                   />
          <Separator />

          <Button Name="simpleButton" Click="simpleButtonClick"
                  >
            Simple
          </Button>
          <Button Name="cubeButton" Click="cubeButtonClick"
                  >
            Cube
          </Button>
        </StackPanel>
      </StackPanel>
      <Viewport3D Name="mainViewport" ClipToBounds="True"
                  >
        <Viewport3D.Camera>
          <PerspectiveCamera FarPlaneDistance="100" FieldOfView="70" LookDirection="-11,-10,-9"
                             NearPlaneDistance="1" Position="11,10,9" UpDirection="0,1,0"
                             />
        </Viewport3D.Camera>
        <ModelVisual3D>
          <ModelVisual3D.Content>
            <DirectionalLight Direction="-2,-3,-1" Color="White"
                              />
          </ModelVisual3D.Content>
        </ModelVisual3D>
      </Viewport3D>
    </DockPanel>
  </Grid>
</Window>
